Skip to content

feat(browsecomp,opencode_multimodal_benchmarks): add a search cache pack and failure kinds for budget-stop masks - #6676

Open
yfw wants to merge 21 commits into
yifuw/mask-judge-replies-without-verdictfrom
yifuw/browsecomp-cache-pack-stop-masks
Open

yfw wants to merge 21 commits into
yifuw/mask-judge-replies-without-verdictfrom
yifuw/browsecomp-cache-pack-stop-masks

Conversation

@yfw

@yfw yfw commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor

What does this PR do?

This PR has three parts. All of them are off by default or keep the current score on shipped configurations.

These changes were written by Jiaqi Zeng (@HeyyyyyyG). The commits after his (docs(browsecomp): ..., the timed_out text fix and the three review-fix commits) are new in this PR.

Issue: none. This is a focused upstream of tested changes, and this body states the reasons.

1. A read-only pack behind the BrowseComp search cache

browsecomp_advanced_harness keeps its search cache as one flat JSON file per entry. A long-lived cache of millions of entries is then millions of small files. A shared filesystem handles that badly: metadata load, file-count quota and slow copies.

  • search_cache_pack.py (new): a read-only pack of the same entries in 512 shard file pairs (an .idx and a .dat per <kind>/<ab> shard). Reads use pread on long-lived file descriptors. Any read or corruption error is a counted miss (pack_errors), never an error in a rollout.
  • search_cache.py: a read tries the flat file first and goes to the pack only when the flat file does not exist. A corrupt flat file stays a miss. A pack entry passes the same shape check as a flat entry. Writes always go to flat files. New stats: search_pack_hits, browse_pack_hits and pack_errors. SearchCache.close() (also a context manager) closes the pack's file descriptors, and the harness calls it at shutdown.
  • build_cache_pack.py (new): an offline tool with build, verify, finalize, status, unpack (rollback) and candidates. candidates lists the flat files that are byte-identical to their packed copy, and only for shards that MANIFEST.json serves at their recorded sizes. build refuses a shard whose pack holds entries with no flat file (run unpack first), so a rebuild cannot drop the only copy of a deleted entry. verify expects a pack hit only for an entry SearchCache accepts. unpack stages each file under its own exclusively created name.
  • build_cache_index.py: the fuzzy index rebuild also indexes the norms of packed search entries whose flat file was deleted, so their queries stay visible to fuzzy matching. It skips packed entries that still have a flat file, and reads only a prefix of the others (about 4 KB of compressed bytes, the same head read as a flat file). An entry whose norm lies past that prefix is read in full.
  • The pack is on only when <cache_root>/pack/MANIFEST.json exists. finalize writes that file last. If the manifest names a shard file that is missing or has the wrong size, the server refuses to start. Each silent miss is a paid provider call, so a loud start failure is the safer choice.
  • The server README has a new "Cache pack" section: build, verify, finalize, when to delete flat files, and how to roll back.

2. Config-gated masks on the BrowseComp agent's legacy /run

browsecomp_agent gets two config fields. Both apply only to the legacy /run path, so a config that sets either one without allow_host_execution: true and a resources_server fails to load.

  • mask_stop_reasons (default []): a row whose response ends with one of these stop_reason values comes back with mask_sample: true and its judged reward kept. The allowed values are the keys of STOP_REASON_FAILURE_KINDS, so an unknown value fails config validation.
  • mask_agent_errors (default false): a row that ended in an agent error (scored 0 with agent_error, for example after /verify answered 5xx) comes back masked instead of as an unmasked 0. A failed judge call does not need this option: /verify already returns that row masked as judge_failed.

A timed-out rollout on /run now goes to /verify like any other row. The resources server already scores it 0 without the judge. On this path no close is sent, so the verify is what releases the session's tool sandbox and workspace. The old timeout branch skipped the verify, so it did not release them. If that /verify call fails, the agent-error row keeps timed_out: 1, so run health still counts it as a timeout.

A test also pins the token-capture prefix: with max_reset_count: 0, the progress board and step nudges on, every model call's input extends the previous call's input and output. It runs with the /tokenize pre-call path off and on.

Possible follow-up, not in this PR: move mask_stop_reasons and its kinds into the _verify of browsecomp_advanced_harness, so agent sessions and other harnesses get the same masks.

3. A failure kind on budget-stop masks

A trainer can keep a masked row in its group baseline only when the rollout's own budget caused the mask. It needs a failure kind to tell that row from an infrastructure failure.

  • browsecomp_agent: a row masked by mask_stop_reasons carries failure_kind agent_limit (max_steps), agent_timeout (timeout), model_context_limit (context_full), or browsecomp_agent:<stop_reason> for the other values. A kind that the resources server already set (for example provider_unavailable) wins.
  • opencode_multimodal_benchmarks (shared by math_tool_rewards, mcqa_tool_rewards, string_match_tool_rewards, llm_judge_tool_rewards and Agent-X): a tool left unfinished under a root invocation that the OpenCode agent stopped at its wall-clock deadline (status: incomplete, error_type: timeout) raises the new RolloutTimeoutToolEvidence. The row is masked with failure_kind: agent_timeout. Any other unfinished or unknown tool record, a call with no record or with a record under another tool name, and a repeated call ID still mask the row as verifier_error, and that error wins when both occur. Tests pin that order. Two commits in the series first trained such a row and then masked it again. The net change against the base is the failure kind only.

agent_limit, agent_timeout and model_context_limit already exist in nemo_gym/core/failure_kinds.py and are in its default model class. The namespaced browsecomp_agent:* kinds have no default class.

Why

A row that stops at its step, time or context budget often scores 0. That 0 says little about the answer. Before this PR, a training config had no way to mask these rows in the BrowseComp agent itself. A masked row also needs a kind, so a trainer can tell "the model ran out of budget" from "our servers failed".

Stack

This PR stacks on #6673 (yifuw/mask-judge-replies-without-verdict), which stacks on #6675. The branch has signed merges of the #6673 branch, the latest at a5b89da7d5, so the diff here shows only this layer. The opencode test change that expects a masked row for an unusable math-judge reply now lives in #6673, so it no longer shows in this diff. After #6675 and #6673 merge, this PR retargets to main.

Related PRs (pointers only)

Validation

Local, CPU only, at the head fa4028852a (after the merge of #6673 at a5b89da7d5), with uv 0.13.9 (uv venv && uv sync --extra dev) and RAY_TMPDIR=/tmp:

Command Result
pre-commit run --all-files passed
gym env test +entrypoint=responses_api_agents/browsecomp_agent +should_validate_data=true 186 passed
gym env test +entrypoint=resources_servers/browsecomp_advanced_harness +should_validate_data=true 566 passed, data validated
gym env test +entrypoint=resources_servers/opencode_multimodal_benchmarks +should_validate_data=true 659 passed, 17 skipped (16 Agent-X video tests need cv2, 1 test needs Node.js or Bun), data validated
gym env test +entrypoint=resources_servers/llm_judge_tool_rewards +should_validate_data=true 85 passed, data validated (shares rewards.py)
gym env test +entrypoint=resources_servers/math_tool_rewards +should_validate_data=true 16 passed, data validated (shares rewards.py)
pytest tests/unit_tests/verification tests/unit_tests/eval/recovery 1606 passed
pytest tests/unit_tests/rollouts (at c15e959a23, and the later commits change no core code) 2946 passed. 4 tests in test_tool_telemetry.py fail locally with KeyError: 'nemo.gym.tool.span_id'. This branch changes nothing in nemo_gym/ or tests/, and CI does not report them.

The new tests for the review fixes fail without their fix: the timed_out row after a failed /verify, the mask refusal without /run, candidates before finalize and with a wrong-size shard file, and the index rebuild after flat files are deleted. The same holds for the tests added for the review bot's findings: the refused rebuild, the rejected-shape entries in verify, the shared staging file in unpack, the descriptors after close(), the misplaced flat copy in the index rebuild, and the inconsistent tool evidence beside a deadline-cut tool.

CI classification: server-only (resources_servers/** and responses_api_agents/**).

Rollouts

The main run below was at 72584a6858. The later commits change only the index-rebuild tool (now about 40 times faster on the sample), merge #6673's inverse_if fixes and fix one word in the candidates summary. The earlier 34-row run and the OpenCode rollout were at 199d45d2ff, before the #6675 and #6673 review fixes, which touch no BrowseComp or OpenCode code.

Rollouts: CPU only, a hosted model as agent and judge. Search was served from a cache pack built with this PR's tooling from a sample of an existing search cache, and cache misses went to live Exa.

  • 20 BrowseComp rows through the agent's legacy /run, with mask_stop_reasons: [max_steps, context_full, timeout] and mask_agent_errors: true:
    • 10 answered rows came back unmasked with no failure kind (5 scored 1.0).
    • 2 max_steps rows came back masked with agent_limit.
    • 6 timeout rows came back masked with agent_timeout.
    • 2 agent errors were masked: one HTTP 502 from the model, and one /verify 500 from a judge reply that held only reasoning, a bug on main, outside this PR.
  • Each timed-out row went through /verify: timed_out: 1, reward 0, no judge call.
  • An earlier run of 34 rows, with cache misses failing locally, gave the same kinds: 11 answered unmasked, 5 max_steps masked with agent_limit and their judged reward kept, and 18 timeout masked with agent_timeout.
  • The cache pack: 20,241 entries (12,173 search, 8,068 browse), with 512 of 512 shards built, verified and finalized.
    • candidates listed 0 files before finalize and 20,241 after.
    • With every flat file deleted, the server served 41 search and 13 browse hits from the pack with 0 pack errors. About 96 misses went to live Exa.
    • build_cache_index.py kept all 12,173 norms.
  • One OpenCode math rollout (math_tool_rewards with tool rewards on) was cut by its 240 s deadline during a sleep 600 bash call. It came back masked with failure_kind: agent_timeout.
  • Not covered by these rollouts: context_full and max_output_tokens. Unit tests cover them.

Compatibility and benchmark impact

  • Shipped configurations keep their scores. mask_stop_reasons is empty and mask_agent_errors is false. The cache pack is off until a MANIFEST.json exists.
  • A config that sets mask_stop_reasons or mask_agent_errors without allow_host_execution: true and a resources_server now fails to load. Both options are new, so no existing config sets them.
  • Legacy /run with rollout_timeout_s, timed-out rollouts. The reward stays 0, and the row now carries the resources server's verify fields (metrics, reasoning). The session's tool sandbox and workspace are released at the end of the rollout. Two rows change:
    • A timed-out row whose tool sandbox failed now comes back masked provider_unavailable. Before, it was an unmasked 0.
    • A timed-out row whose /verify answers 5xx or cannot connect is now kill_shaped with _ng_no_persist, so a resume runs it again. It keeps timed_out: 1. Before, it was a settled 0.
  • opencode_multimodal_benchmarks training servers: a rollout cut mid-tool by its deadline was masked as verifier_error and is now masked as agent_timeout. It stays masked with reward 0. A trainer that groups or excludes masked rows by kind sees the new kind. gym eval recovery treats a verifier_error row as evaluation-side, so it can offer the row for --rerun-masked-without-artifact. An agent_timeout row that kept its answer is the model's final result, so recovery no longer offers these rows.
  • Under NeMo RL's grpo.masked_reward_policy: exclude_infra, a masked row stays in its group baseline only when its kind is in grpo.policy_failure_kinds. A recipe that masks max_output_tokens must add browsecomp_agent:max_output_tokens to that list. The list replaces the default list, so the recipe must also list the default kinds.
  • When configured, rows that stop at a budget are masked, so they leave the loss. They carry a model-stop failure kind, so a trainer can tell them from infrastructure failures. For example, a group-baseline policy that drops infrastructure kinds can keep these rows. gym eval also leaves masked rows out of the score, which can raise the mean, so these masks are for training.
  • No shipped config files or data change.

Checklist

  • I have read the contributing guidelines.
  • The change is focused; unrelated "drive-by" edits are tracked as separate issues/PRs.
  • Tests added or updated and pass locally, or N/A for docs-only / non-code changes (so CI unit/server checks pass when applicable).
  • Documentation added or updated, or N/A with justification.
  • Pre-commit checks pass locally (pre-commit run --all-files) (so CI lint/format checks pass).
  • New source files include the required Apache-2.0 SPDX header.
  • All commits have DCO sign-off (git commit -s) (so the DCO check passes).

🤖 Generated with Claude Code

HeyyyyyyG and others added 7 commits November 23, 2026 15:17
The search cache keeps one flat file per entry. A long-lived cache of millions
of entries is then millions of small files, which a shared filesystem handles
badly (metadata load, file-count quota, slow copies). This adds a read-only
pack of the same entries in 512 shard file pairs, behind the flat cache.

- search_cache_pack.py: the pack format and its reader. One shard holds the
  flat files of one <kind>/<ab>/ directory. Reads use pread on long-lived file
  descriptors. Any read or corruption error is a counted miss, never an error
  in a rollout.
- search_cache.py: a read tries the flat file first and goes to the pack only
  when the flat file does not exist. A corrupt flat file stays a miss, and a
  pack entry passes the same shape check. Writes always go to flat files. The
  pack is on only when pack/MANIFEST.json exists. New stats: search_pack_hits,
  browse_pack_hits and pack_errors.
- build_cache_pack.py: an offline tool that builds, verifies and finalizes the
  pack, reports its status, unpacks it again (rollback), and lists the flat
  files that are byte-identical to their packed copy.
- app.py: the startup log names the pack generation.

A cache root without a pack behaves as before.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Jiaqi Zeng <jiaqiz@nvidia.com>
Signed-off-by: Yi-Fu Wu <yifu.wu@gmail.com>
…timed-out rollouts

This lets a training config mask budget stops and agent errors in the agent
itself, on the legacy /run path:

- mask_stop_reasons (default empty): a row whose response ends with one of
  these stop_reason values comes back with mask_sample true and its judged
  reward kept. A training framework reads mask_sample from the row.
- mask_agent_errors (default false): a row that ended in an agent error
  (scored 0 with agent_error, for example a /verify 500 after a judge that
  never answered) comes back masked instead of as an unmasked 0.
- A timed-out rollout now goes to /verify like any other. The resources
  server already scores it 0 without the judge. On this path no close is
  sent, so the verify is what releases the session's tool sandbox and
  workspace. The old timeout branch skipped that.

The defaults keep the previous scoring.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Jiaqi Zeng <jiaqiz@nvidia.com>
Signed-off-by: Yi-Fu Wu <yifu.wu@gmail.com>
…en-capture prefix)

A training config can run the host loop with max_reset_count 0 and with the
progress board and step nudges on. Token capture links each model call to the
one before it by prefix. This test checks call by call that every input
extends the previous input and output under those settings (prompts over the
reset threshold on every call, nudges at the quarter, half and near-end
steps). It also checks that the same run with resets uncapped does rewrite the
history.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Jiaqi Zeng <jiaqiz@nvidia.com>
Signed-off-by: Yi-Fu Wu <yifu.wu@gmail.com>
…heir timeout

Before, trajectory_tool_reward raised ToolEvidenceError for any tool record
left "incomplete", so a rollout that hit its wall-clock timeout while a tool
was running was masked (verifier_error) and never trained. A rollout timeout is
the model's budget, so when the tool's root invocation records the harness
deadline (status "incomplete", error_type "timeout", set by the OpenCode agent
when its process timed out) the cut tool now scores as a failed call, like a
tool's own timeout, and the row is graded normally (usually 0) and trained.

Still masked: missing records, "unknown" outcomes, and unfinished tools under a
root that did not record a timeout (cancelled, server error, or no evidence).
Shared by math/mcqa/string_match/llm_judge_tool_rewards and Agent-X.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Jiaqi Zeng <jiaqiz@nvidia.com>
Signed-off-by: Yi-Fu Wu <yifu.wu@gmail.com>
…able math-judge reply

math_tool_rewards inherits math_with_judge's judge parsing, which now raises
JudgeError for a judge reply that is cut off or names no verdict (#6673).
Route the test through judge_failsafe, as the /verify route does, and assert
that those cases come back masked (judge_failed / judge_unparseable). Usable
verdicts are still graded and shaped as before.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Jiaqi Zeng <jiaqiz@nvidia.com>
Signed-off-by: Yi-Fu Wu <yifu.wu@gmail.com>
…del-stop failure kind

A trainer can keep a masked row in the group baseline only when the mask
comes from the rollout's own budget. It needs a failure kind to tell that
mask from an infrastructure failure.

- browsecomp_agent: a row masked by mask_stop_reasons carries failure_kind
  agent_limit (max_steps), agent_timeout (timeout), model_context_limit
  (context_full), or browsecomp_agent:<stop_reason>, unless the resources
  server already set a kind.
- opencode_multimodal_benchmarks: a rollout cut mid-tool by its wall-clock
  deadline is masked again (reward 0, as before the earlier fix in this
  series), now with failure_kind agent_timeout. Any other unfinished or
  unknown tool evidence stays a verifier_error mask and takes precedence.

Signed-off-by: Jiaqi Zeng <jiaqiz@nvidia.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Yi-Fu Wu <yifu.wu@gmail.com>
- browsecomp_agent README: give the legacy /run mask options their own
  paragraph and list each stop's failure kind.
- browsecomp_advanced_harness: a comment said that the agent's /run scores a
  timed-out rollout without a verify. The /run now sends it to /verify too.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Yi-Fu Wu <yifu.wu@gmail.com>
@copy-pr-bot

copy-pr-bot Bot commented Nov 23, 2026

Copy link
Copy Markdown

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@yfw yfw added area:environment Individual environments, benchmarks, verifiers, and environment-specific resources servers feature New capabilities, enhancements, or enablement work needs-review PR is ready for code review and waiting on a reviewer labels Nov 23, 2026
@yfw

yfw commented Nov 23, 2026

Copy link
Copy Markdown
Contributor Author

/ok to test b9ea7d7

…owsecomp-cache-pack-stop-masks

Signed-off-by: Yi-Fu Wu <yifu.wu@gmail.com>
@nemo-automation-bot
nemo-automation-bot Bot requested review from a team November 23, 2026 23:28
@yfw

yfw commented Nov 23, 2026

Copy link
Copy Markdown
Contributor Author

/ok to test ad19089

@svcnvidia-nemo-ci svcnvidia-nemo-ci added the risk:high Autobot PR risk: high label Nov 23, 2026
… for

nemo_gym/rollouts/health/timeouts.py lists browsecomp_agent's timed_out field
as a legacy timeout signal. A core test checks that its producer still holds
the text update={"timed_out": int(bool(. The stop-reason mask had moved the
value into a local dict, so the check failed although the field is still
written. Build the stop-reason mask first and pass the timed_out update
inline again.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Yi-Fu Wu <yifu.wu@gmail.com>
@yfw

yfw commented Nov 23, 2026

Copy link
Copy Markdown
Contributor Author

/ok to test f854249

@yaoyu-33
yaoyu-33 requested a review from marta-sd November 24, 2026 00:39
yfw and others added 3 commits November 23, 2026 16:49
- A timed-out rollout whose /verify fails keeps timed_out: 1 on its
  agent-error row, so run health counts it as a timeout.
- The mask_stop_reasons type comes from STOP_REASON_FAILURE_KINDS, so a
  value without a kind fails when the config loads instead of turning a
  masked row into an agent error.
- mask_stop_reasons and mask_agent_errors are refused when the config
  cannot serve /run (no allow_host_execution or no resources_server).
- The mask_agent_errors example is a /verify 5xx. A failed judge call
  already comes back from /verify as a judge_failed mask.
- The agent README says that these masks also leave rows out of gym eval
  scores. Comments and docs no longer say that nothing reads stop_reason,
  or that /run skips /verify after a timeout.
- The token-capture prefix test also runs with the /tokenize pre-call path
  on.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Yi-Fu Wu <yifu.wu@gmail.com>
- candidates lists a flat file only when MANIFEST.json serves its shard and
  the shard files still have their recorded sizes. Before, it also listed
  files of verified shards that the server could not yet serve.
- build_cache_index.py also indexes the norms of packed search entries, so
  a rebuild after flat files are deleted keeps those queries visible to
  fuzzy matching.
- The startup error says to run unpack before moving MANIFEST.json aside.
- The README gets a Cache pack section: how to build, verify and finalize,
  when it is safe to delete flat files, and how to roll back.
- The build_cache_pack usage line names this server's venv, and the pack
  hit counters are described as they behave.
- The pack tests build one template pack per module and copy it per test.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Yi-Fu Wu <yifu.wu@gmail.com>
…r a tool cut by the deadline

A row with a tool cut by the rollout timeout and then a tool with an
unknown outcome is masked as verifier_error, not agent_timeout. This pins
the order that trajectory_tool_reward documents.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Yi-Fu Wu <yifu.wu@gmail.com>
@yfw yfw changed the title feat(browsecomp): add a search cache pack and failure kinds for budget-stop masks feat(browsecomp,opencode_multimodal_benchmarks): add a search cache pack and failure kinds for budget-stop masks Nov 24, 2026
@yfw

yfw commented Nov 24, 2026

Copy link
Copy Markdown
Contributor Author

/ok to test 32b2054

…owsecomp-cache-pack-stop-masks

Signed-off-by: Yi-Fu Wu <yifu.wu@gmail.com>
@yfw

yfw commented Nov 24, 2026

Copy link
Copy Markdown
Contributor Author

/ok to test 199d45d

yfw and others added 2 commits November 24, 2026 12:57
…owsecomp-cache-pack-stop-masks

Signed-off-by: Yi-Fu Wu <yifu.wu@gmail.com>
…s in the baseline

browsecomp_agent:max_output_tokens is not one of NeMo RL's default policy
failure kinds. Under exclude_infra, a recipe that masks max_output_tokens
must add that kind to grpo.policy_failure_kinds, and that list replaces
the default list.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Yi-Fu Wu <yifu.wu@gmail.com>
@yfw

yfw commented Nov 24, 2026

Copy link
Copy Markdown
Contributor Author

/ok to test 72584a6

yfw and others added 3 commits November 24, 2026 13:46
candidates also skips a verified shard that MANIFEST.json does not serve
yet, or whose files are not at their recorded sizes. The summary line
called all of them "unverified".

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Yi-Fu Wu <yifu.wu@gmail.com>
…ebuild

The rebuild read and inflated every packed search entry to get its norm,
even when the flat file still existed and had already been scanned. On a
pack of 12M search entries that is about 2 TB of reads and hours of work.

Now each shard <ab> is one task:

- It scans the flat files under search/<ab>/ first.
- It skips packed entries that have a flat file.
- For the rest, it reads a prefix of the blob: 4 KB of compressed bytes,
  inflated to the same 8 KB head as a flat file, and the same regex.
- An entry whose norm lies past that prefix is read in full and counted.
  So no norm is lost.
- The rebuild prints the counts.

Timed on a sample of 12,173 search and 8,068 browse entries (2.2 GB pack,
node-local disk, page cache not dropped), same 12,173 norms each time:

- flat files present: 32.8 s before, 0.8 s after (1 worker); 33.2 s and
  0.3 s (32 workers)
- flat files deleted: 31.7 s before, 0.8 s after (1 worker); 31.2 s and
  0.3 s (32 workers), all 12,173 norms from a prefix

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Yi-Fu Wu <yifu.wu@gmail.com>
…owsecomp-cache-pack-stop-masks

Signed-off-by: Yi-Fu Wu <yifu.wu@gmail.com>
@yfw

yfw commented Nov 24, 2026

Copy link
Copy Markdown
Contributor Author

/ok to test c15e959

…owsecomp-cache-pack-stop-masks

Signed-off-by: Yi-Fu Wu <yifu.wu@gmail.com>
@yfw

yfw commented Nov 24, 2026

Copy link
Copy Markdown
Contributor Author

/ok to test f0037b8

@github-actions github-actions Bot added the sla:review-overdue Review response is over the one-business-day SLA label Nov 25, 2026
@marta-sd

Copy link
Copy Markdown
Contributor

/review

@svcnvidia-nemo-ci svcnvidia-nemo-ci left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SHIP WITH CARE

I reviewed all 15 changed files and their connected callers, consumers and tests, with three delegated topic reviews. I found four RISKs and two optional NOTEs. The main concerns are cache rebuild/rollback safety and preserving verifier-failure attribution when a rollout also times out.

CI: On f0037b83eb37f454dc45956e50af80e5083b1071, I relied on successful Nemo_CICD_Test, Unit tests / Test, changed-server tests, core coverage and Lint check. Environment Server compliance (non-blocking) and its publish check failed; I have not attributed those failures to this change. Build Gym container was skipped, not passed.

Local validation: I used 766267172432.dkr.ecr.us-east-1.amazonaws.com/gym:9901a1c9bbe5a404a1df1e72a7b40cfa30c4afc0, the successful scheduled-main build from run 45611083527, because this head had no successful image build. Purpose-built CPU probes covered packed/flat equivalence for 99 search payloads, fuzzy-index rebuilding after deleting flat trees, 600 concurrent lookups, transient read recovery, raw storage, overlays, rebuilds and rollback. Base/head verifier probes reproduced the attribution issue below. Mocked BrowseComp probes confirmed timeout verification releases resources without calling the judge and preserves an existing provider-failure kind.

I corrected image-source shadowing and reran the key probes with assertions that imported Gym components came from the admitted trees. RapidFuzz was installed in scratch for fuzzy probes; cleanup probes used import-only stubs for unused external integrations. Existing CI suites were not rerun. No live model, search provider, GPU or multi-node filesystem test ran. All three admitted worktrees were clean at completion.

Review generated by codex. This was a full review. Request a full review with /review reset=true.

@marta-sd marta-sd left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I haven't reviewed the details because a) this PR is too massive and b) I lack context.

I checked high-level and it looks good. I also verified that it shouldn't negatively impact P0 Nemotron evals our team runs.

@yfw please address bot's comments and we're good to go

@github-actions github-actions Bot removed the sla:review-overdue Review response is over the one-business-day SLA label Nov 26, 2026
yfw and others added 2 commits November 30, 2026 09:08
…fore the deadline kind

A tool cut by the rollout timeout raised RolloutTimeoutToolEvidence before
score_opencode_tools ran its checks. So a trace with a cut tool and a call
with no record, a record under another tool name, or a repeated call ID came
back masked agent_timeout instead of verifier_error. That moved the row from
evaluation-side recovery to the model's own result.

Now those checks run first, in either order of the calls. A trace whose only
gap is the cut tool is still masked agent_timeout.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Yi-Fu Wu <yifu.wu@gmail.com>
- build refuses a shard whose published pack holds entries with no flat
  file. After `candidates` deletions, a rebuild from the flat files alone
  dropped them, and nothing could restore them. The refusal leaves the old
  shard as it was and says to run `unpack` first. The CLI reports refused
  shards and exits 1. The README states the order.
- verify's sample check expects a pack hit only for an entry SearchCache
  accepts. A correctly keyed entry of a rejected shape (for example
  `results: {}`) is a miss from both copies, and no longer blocks finalize.
- unpack stages each restored file under its own exclusively created name
  with a random suffix. A PID-only name repeats across nodes and containers
  that share the root, so two restores could share and truncate one file.
- SearchCache.close() (also a context manager) closes the pack's file
  descriptors. The harness calls it at shutdown.
- The index rebuild skips a packed entry only for a flat file at its
  canonical <ab>/<cd>/<digest>.json. A misplaced copy, which SearchCache
  never reads, no longer hides the packed norm.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Yi-Fu Wu <yifu.wu@gmail.com>
@yfw

yfw commented Nov 30, 2026

Copy link
Copy Markdown
Contributor Author

/ok to test fa40288

@nemo-automation-bot
nemo-automation-bot Bot requested a review from a team November 30, 2026 17:09
@yfw

yfw commented Nov 30, 2026

Copy link
Copy Markdown
Contributor Author

@marta-sd Thanks. All six of the bot's threads are fixed in 23af177 and fa40288, and each thread has a reply and is resolved. Each fix has a test that fails without it. The four RISKs: a rebuild no longer drops packed-only entries, verify no longer fails on entries SearchCache rejects, unpack no longer shares a staging file, and inconsistent tool evidence stays verifier_error next to a deadline-cut tool. The two NOTEs: SearchCache.close(), and canonical flat paths in the index rebuild. CI is running on the new head fa40288.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:environment Individual environments, benchmarks, verifiers, and environment-specific resources servers feature New capabilities, enhancements, or enablement work needs-review PR is ready for code review and waiting on a reviewer risk:high Autobot PR risk: high

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants